@model ZKEACMS.Article.Models.ArticleEntity
@{
    Script.Reqiured("validate").AtFoot();
    Script.Reqiured("tinymce").AtFoot();
    string publicUrl = articleUrlService.GetPublicUrl(Model)?.FirstOrDefault();
}
@inject ZKEACMS.Article.Service.IArticleUrlService articleUrlService
<div class="panel panel-default">
    <div class="panel-heading">
        <span class="badge">
            @(Model.IsPublish ? L("Published") : L("Unpublished"))
        </span>
        @if (Model.IsPublish && publicUrl.IsNotNullAndWhiteSpace())
        {
            <span class="pull-right">
                <a href="@Url.PathContent(publicUrl)" target="_blank" class="badge glyphicon glyphicon-share-alt">
                </a>
            </span>
        }
    </div>
    <div class="panel-body">
        @using (Html.BeginForm())
        {
            @Html.EditorForModel()
            <div class="toolBar">
                @if (Authorizer.Authorize(ZKEACMS.Article.PermissionKeys.ManageArticle))
                {
                    <input type="submit" class="btn btn-primary" value="@L("Save")" data-value="@(ActionType.Update)" />
                    <input type="submit" class="btn btn-primary" value="@L("Save And Exit")" data-value="@(ActionType.UpdateAndExit)" />
                }
                @if (Authorizer.Authorize(ZKEACMS.Article.PermissionKeys.PublishArticle))
                {
                    <input type="submit" class="btn btn-info publish" value="@L("Publish")" data-value="@ActionType.Publish" />
                }
                <a class="btn btn-default" href="@Url.Action("Index")">@L("Cancel")</a>
            </div>
        }
    </div>
</div>